<template>
  <d2-container>
    <div class="d2-breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>房东审核</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <el-form :inline="true" class="SearchForm">
      <el-form-item label="UID">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.uuid"
          
        ></el-input>
      </el-form-item>
      <el-form-item label="手机">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.phone"
          
        ></el-input>
      </el-form-item>
      <el-form-item label="真实姓名">
        <el-input
          placeholder="请输入"
          type="text"
          v-model.trim="searchForm.phone"
          
        ></el-input>
      </el-form-item>
      <el-form-item label="注册时间">
        <el-select v-model="searchForm.region">
          <el-option label="一" value="shanghai"></el-option>
          <el-option label="二" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="申请类型">
        <el-select v-model="searchForm.region">
          <el-option label="一" value="shanghai"></el-option>
          <el-option label="二" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-button type="primary" @click="search()" icon="el-icon-search"
        >查询</el-button
      >
      <el-button type="danger" icon="el-icon-refresh" @click="reset"
        >重置</el-button
      >
    </el-form>
    <el-table border :data="tableData.list">
      <el-table-column label="UID" align="center" prop="_id"></el-table-column>
      <el-table-column
        label="用户头像"
        align="center"
        prop="title"
      ></el-table-column>
      <el-table-column
        label="用户昵称"
        align="center"
        prop="title"
      ></el-table-column>
      <el-table-column
        label="用户手机"
        align="center"
        prop="title"
      ></el-table-column>
      <el-table-column
        label="姓名"
        align="center"
        prop="title"
      ></el-table-column>
      <el-table-column
        label="身份证号"
        align="center"
        prop="title"
      ></el-table-column>

      <el-table-column label="提交时间" align="center" prop="create_time">
        <template slot-scope="scope">
          {{ $moment(scope.row.create_time).format("YYYY-MM-DD hh:mm:ss") }}
        </template>
      </el-table-column>

      <el-table-column
        label="申请类型"
        align="center"
        prop="title"
      ></el-table-column>
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button
            type="text"
            class="margin-left"
            @click="showInfo(scope.row._id)"
            >查看</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="search"
      @current-change="search"
      :current-page.sync="page"
      :page-sizes="[10, 25, 50, 100]"
      :page-size.sync="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="tableData.count"
    ></el-pagination>

    <!-- 新增弹窗 -->
    <el-dialog
      title="申请信息"
      :visible.sync="dialogVisible"
      width="400px"
      class="dialog-box"
    >
      <el-form label-width="100px" :model="query" :rules="rules" ref="add">
        <el-form-item label="申请类型" prop="title">
          <el-input v-model="query.title" style="width: 240px" disabled></el-input>
        </el-form-item>
        <el-form-item label="真实姓名" prop="title">
          <el-input v-model="query.title" style="width: 240px"></el-input>
        </el-form-item>
        <el-form-item label="身份证号" prop="title">
          <el-input v-model="query.title" style="width: 240px"></el-input>
        </el-form-item>
        <el-form-item label="身份证国徽面" prop="title">
          
            <img
              :src="`http://collect.img.dappbox.finance/${query.title}`"
              alt=""
              style="width: 300px"
            />
        </el-form-item>
        <el-form-item label="身份证人像面" prop="title">
         
            <img
              :src="`http://collect.img.dappbox.finance/${query.title}`"
              alt=""
              style="width: 300px"
            />
          
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">驳回</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >通过</el-button
        >
      </span>
    </el-dialog>
  </d2-container>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      searchForm: {
        user_name: "",
      },
      query: {},
      tableData: {
        list: [{}],
        count: 0,
      },
      page: 1,
      pageSize: 10,
      dialogVisible: false,
    };
  },
  methods: {
    search() {
      let params = {
        page: this.page,
        page_size: this.pageSize,
        ...this.searchForm,
      };

      this.$axios.post("/admin/getNoteList", params).then((result) => {
        if (result) {
          this.tableData = result;
        } else {
          this.$message.error(result.data.msg);
        }
      });
    },
    reset() {
      this.searchForm = {};
      this.search();
    },
    showInfo() {
      this.dialogVisible = true;
    },
  },
  created() {
    // this.search();
  },
};
</script>

<style scoped lang="scss">
</style>
